package com.ja.planclass.mapper;

import com.ja.planclass.model.PlanClass;
import com.ja.planclass.model.PlanClassSelectVo;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * Created by 86151 on 2019/4/22.
 */
@Mapper
public interface PlanClassMapper {
    @Insert("insert into planclass (code,remark,status,createTime,createName) value (#{code},#{remark},#{status},#{createTime},#{createName})")
    int addPlanClass(PlanClass planClass);

    @Select("select * from planclass where code = #{code}")
    List<PlanClass> queryPlanClassByCode(String code);

    @Select("select * from planclass where remark = #{remark}")
    List<PlanClass> queryPlanClassByName(String remark);

    /**
     * 根据多个计划大类编码查询计划大类信息
     * @param
     * @return
     */

    @SelectProvider(type = PlanClassMapperImpl.class, method = "queryPlanClassByCodeList")
    List<PlanClass> queryPlanClassByCodeList(@Param("codes") List<String> codes);

    @SelectProvider(type = PlanClassMapperImpl.class, method = "queryPageTest")
    List<PlanClass> queryPageTest(PlanClassSelectVo planClassSelectVo);


    int queryCount(PlanClassSelectVo planClassSelectVo);
    List<PlanClass> queryPage(PlanClassSelectVo planClassSelectVo);


    /**
     * 根据多个名称查询计划大类信息
     */
    List<PlanClass> findPlanClassByNameList(List<String> nameList);

    /**
     * 批量新增
     */
    int addPlanClassList(List<PlanClass> planClassList);
    /**
     * 批量修改
     */
    int updatePlanClassList(List<PlanClass> planClassList);
    /**
     * 批量删除
     */
    int deletePlanClassByIdList(List<Integer> idList);
}
